package com.gomyb.redis.serializer;

import org.springframework.data.redis.serializer.RedisSerializer;
import org.springframework.data.redis.serializer.SerializationException;

import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;

/**
 * @author <a href="mailto:hellohesir@gmail.com">Mr_He</a>
 * 2019/9/19 15:47
 */
public class RedisStringSerializer implements RedisSerializer<byte[]> {

    private final Charset charset = StandardCharsets.UTF_8;

    @Override
    public byte[] serialize(byte[] o) throws SerializationException {
        return o;
    }

    @Override
    public byte[] deserialize(byte[] bytes) throws SerializationException {
        return bytes;
    }
}
